{include file="Public:header2"/}
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <form method="get" class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <div class="layui-input-inline" style="width: 300px;margin-left: 0px">
                        <input type="text" name="username" value="{$Request.get.username}" placeholder="账号" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <!--<div class="layui-inline">-->
                <!--    <div class="layui-input-inline" style="width: 300px;margin-left: 0px">-->
                <!--        <input type="text" name="nickname" value="{$Request.get.nickname}" placeholder="姓名" autocomplete="off" class="layui-input">-->
                <!--    </div>-->
                <!--</div>-->
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="LAY-user-front-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </form>

        <div class="layui-card-body">
            <xblock>
                <div style="padding-bottom: 10px;">
                    <span style="line-height:40px;float:right;">共有数据： {$count}条</span>
                </div>
            </xblock>
            <table class="layui-table">
                <thead>
                <tr>
                    <th>账号</th>
                    <th>ip</th>
                    <th>操作控制器</th>
                    <th>操作内容</th>
                    <th>添加时间</th>
<!--                    <th>操作</th>-->
                </tr>
                </thead>
                <tbody>
                {volist name="list" id="vo"}
                <tr>
                    <td>{$vo['ad_name']}</td>
                    <td>{$vo['ip']}</td>
                    <td>{$vo['operation']}</td>
                    <td>{$vo['content']}</td>
                    <td>{$vo.addtime|date="Y-m-d H:i:s"}</td>
                </tr>
                {/volist}
                {if condition="empty($list)"}
                <tr>
                    <td colspan='10' style="text-align:center;">暂时没有数据！</td>
                </tr>
                {/if}
                </tbody>
            </table>
            <div class="my_page layui-box layui-laypage layui-laypage-default">
                {$page|raw}
            </div>
        </div>
    </div>
</div>
{include file="Public:footer"/}
<script type="text/javascript">
    layui.use(['laydate','table'], function(){
        var laydate = layui.laydate;

    });

    //添加
    function admin_add() {
        var url  = "{:url('/admin/admins/admin_add')}";
        layer.open({
            type: 2,
            title: '添加管理员',
            shadeClose: false,
            shade: 0.3,
            area: ['50%', '80%'],
            content: url,
        });
    }

    //编辑
    function admin_edit(id) {
        var url  = "{:url('/admin/admins/admin_edit?id="+id+"')}";
        layer.open({
            type: 2,
            title: '编辑管理员',
            shadeClose: false,
            shade: 0.3,
            area: ['50%', '80%'],
            content: url,
        });
    }


    //状态
    function admin_status(id,status,name){
        var $ = layui.$;
        layer.confirm('确认要执行'+name+'操作吗',function(){
            var url="{:url('/admin/admins/admin_status')}";
            var load=layer.load(2);
            $.post(url,{id:id,status:status},function(data){
                if(data.status==1){
                    layer.msg(data.msg,{icon:1,time:1500},function(){
                        location.reload();
                    });
                }else{
                    layer.msg(data.msg,{icon:2,time:1500},function(){
                        layer.close(load);
                    });
                }
            });
        });
    }



</script>
</body>
</html>